angular.module('mamApp').factory('ProgramAuditManager', ['$http', 'api', 'paramsManager', function ($http, api, paramsManager) {
    var ProgramAuditManager = {
        /**
         * 节目审核列表
         * @param params
         * @returns
         */

        programList: function (params, query) {
            return $http.get(api + '/admin/programs/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 节目信息
         * @param programId
         * @returns {*|IThenjsProto|IPromise<TResult>|IPromiseLike<TResult>}
         */
        programDetail: function (programId) {
            return $http.get(api + '/admin/programs/' + programId).then(function (result) {

                return result;
            });
        },
        /**
         * 节目不通过
         * @param programId
         * @returns {*|IThenjsProto|IPromise<TResult>|IPromiseLike<TResult>}
         */
        programsUnPass: function (ids) {
            return $http.put(api + '/admin/programs/reviewStatus/' + ids.join(",")).then(function (result) {
                return result;
            });
        },
        /**
         * 节目信息
         * @param programId params
         * @returns {*|IThenjsProto|IPromise<TResult>|IPromiseLike<TResult>}
         */
        programEdit: function (programId, params) {
            return $http.put(api + '/admin/programs/' + programId, params).then(function (result) {
                return result;
            });
        },
        /**
         * 专辑下面的节目列表
         * @param programId params
         * @returns {*|IThenjsProto|IPromise<TResult>|IPromiseLike<TResult>}
         */
        programByAlbumId: function (albumId, params, query) {
            return $http.get(api + '/admin/album/' + albumId + '/programs/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 专辑下面的节目列表排序
         * @param
         * @returns {*|IThenjsProto|IPromise<TResult>|IPromiseLike<TResult>}
         */
        programSort: function (albumId, params) {
            return $http.put(api + '/admin/album/' + albumId + '/programSort', params).then(function (result) {
                return result;
            });
        },
        /**
         * 节目的所有二级频道
         * @param
         * @returns
         */
        programChannels: function () {
            return $http.get(api + '/admin/programs/channels').then(function (result) {
                return result;
            });
        }

        ,
        /**
         * 节目的筛选的审核人列表
         * @param
         * @returns
         */
        programCheckUsers: function () {
            return $http.get(api + '/admin/programs/adminUsers').then(function (result) {
                return result;
            });
        }


    };

    return ProgramAuditManager;
}]);
